﻿/*
 *mysql.h
 *说明：封装的SQL连接
*/

#ifndef MYSQL_H
#define MYSQL_H

#include <QObject>
#include "QMessageBox"
#include "QSqlError"
#include "QDebug"
#include "QSqlQuery"

#include "executeresults.h"
class MySql :public QObject
{
public:
    MySql(QObject *parent = 0);

    QSqlDatabase connectDB();
    ExecuteResults DbExecute(QSqlDatabase db, QString str);

private:
    QString dbDriver;
    QString dbName;
    QString userName;
    QString userPwd;
    QString hostName;
    int hostPort;
public:
    QSqlDatabase db;
};
#endif
